using System;
using System.Reflection;
using System.Diagnostics;

namespace Dida
{
	public static class Geometry
	{
		static bool inited = false;

		public static void Init()
		{
			Debug.Assert(!inited, "Geometry.Init should only be called once");

			RegisterParsers();

			Module module = typeof(Geometry).Module;
			Dxml.DidaXml.ScanModule(module);

			inited = true;
		}

		public static void Free()
		{
		}

		public static bool IsInitialized
		{
			get { return inited; }
		}

		private static void RegisterParsers()
		{
			ParsersRegister.Default.ScanType(typeof(Vector2D));
			ParsersRegister.Default.ScanType(typeof(Vector3D));
			ParsersRegister.Default.ScanType(typeof(Vector4D));
			ParsersRegister.Default.ScanType(typeof(Quaternion));
			ParsersRegister.Default.ScanType(typeof(EulerRot));
		}
	}
}